<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="../node_modules/react/umd/react.development.js"></script>
    <script src="../node_modules/react-dom/umd/react-dom.development.js"></script>
    <script src="../node_modules/babel-standalone/babel.min.js"></script>
  </head>
  <body>
    <div id="reactDom"></div>
    <script type="text/babel">
      //   function Com(props) {
      //     return (
      //       <div>
      //         我是一个无状态组件-----外部传递数据是:{props.text}---{props.num}
      //       </div>
      //     );
      //   }
      //   let demo = "我是数据";

      //   ReactDOM.render(
      //     <Com text={demo} num="111" />,
      //     document.getElementById("reactDom")
      //   );

      function Com(props) {
        return (
          <div>
            我是一个无状态组件-----外部传递数据是:{props.text}---{props.num}
          </div>
        );
      }
      let obj = {
        text: "我是text数据",
        num: "我是num",
      };

      ReactDOM.render(<Com {...obj} />, document.getElementById("reactDom"));
    </script>
  </body>
</html>
